from PyQt4 import QtGui,QtCore
from ftllibs.FTL import CHAMPS as CHAMPS

class UI_SlotItemDisplay(QtGui.QWidget):
    def __init__(self,parent=None):
        super(UI_SlotItemDisplay,self).__init__()
        self.Champ=None
        self.Build=None
        self.IconList=[]

    def SetChamp(self,Champ):
        self.Champ=Champ
        self.LoadIcons()

    def paintEvent(self,e):
#        print "UI_SlotItemDisplay: paintEvent: Called"
        painter=QtGui.QPainter(self)
        for i in self.IconList:
            painter.drawPixmap(0,0,i)
        
    def LoadIcons(self):
        print "UI_SlotItemDisplay: LoadIcons: Called"
        self.IconList=[]
        print self.Champ.Build
        for i in range(1,7):
            if self.Champ.Build[str(i)] == False:
                continue
            else:
                pix = QtGui.QPixmap(64,64)
                pix.loadFromData(self.Champ.Build[str(i)].IconData)
                self.IconList.append(pix)
        self.update()
